<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <button @click="changePic">切换图片</button>
        <!-- <img v-bind:src="src_str" id="img" alt=""> -->
        <img :src="src_str" alt="">
        <!-- <img :[src_name]="src_str" id="img" alt=""> -->

    </div>
</body>
<script src="https://cn.vuejs.org/js/vue.js"></script>
<script>
    let vm = new Vue({
        el:"#app",
        data:{
            src_name:"src",
            msg:"123",
            src_str:"../img/a.jpg"
        },
        methods:{
            changePic:function(){
                this.src_str = "../img/b.jpg";
            }
        }
    })
</script>
</html>